package com.zhuss.controller.core;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zhuss.bean.bo.core.area.DetailAreaBo;
import com.zhuss.bean.bo.core.area.SearchAreaBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.ReadService;
import com.zhuss.core.area.AreaReadServiceExt;
import com.zhuss.exception.OceanException;


/**
 * @description: 地域查询Controller
 * @author: zhushanshuo
 * @create: Thu Apr 08 20:24:46 CST 2021
 **/
@RestController
@RequestMapping("/area")
public class AreaReadController extends BaseController {
	
	@Autowired
	@Qualifier("areaReadService")
	private ReadService<Object, Object> areaReadService;
	
	@Autowired
	@Qualifier("areaReadServiceExt")
	private AreaReadServiceExt areaReadServiceExt;
	
	/**
	 * 详情
	 * @param bo
	 * @return
	 * @throws OceanException
	 */
	@ResponseBody
	@RequestMapping("/detail")
    public Object detail(@RequestBody DetailAreaBo bo) throws OceanException {
		
		Object result = areaReadService.detail(bo);
		return result;
    }
	
	/**
	 * 列表
	 * @param bo
	 * @return
	 * @throws OceanException
	 */
	@ResponseBody
    @RequestMapping("/list")
    public Object list(@RequestBody SearchAreaBo bo) throws OceanException {
		
		Object result = areaReadService.list(bo);
		return result;
    }
	
}
